﻿namespace X2OPC.Server
{
    using System;
    using System.Collections.Generic; 
    using X2OPC.Server.DA;

    internal class OPCServer
    {
        private static object obj = new object();
        private static OPCServer opcServer;
        private OPCServer()
        {
            OPCDAServers = new List<OPCDAServer>();
        }

        internal List<OPCDAServer> OPCDAServers { get; private set; }

        internal static OPCServer CreateOPCServer()
        {
            if (opcServer == null)
            {
                lock (obj)
                {
                    if (opcServer == null)
                    {
                        opcServer = new OPCServer();
                    }
                }
            }
            return opcServer;
        } 
    }
}
